package slogx

import (
	"io"

	"gopkg.in/natefinch/lumberjack.v2"
)

// NewRotatingWriter 返回支持轮转的 io.Writer
func NewRotatingWriter(filename string) io.Writer {
	return &lumberjack.Logger{
		Filename:   filename,
		MaxSize:    100, // MB
		MaxBackups: 7,
		MaxAge:     30, // days
		Compress:   true,
	}
}
